package com.zy.qudadid.presenter;

import com.zy.qudadid.model.About;
import com.zy.qudadid.model.Res;
import com.zy.qudadid.network.Const;
import com.zy.qudadid.network.Net;
import com.zy.qudadid.presenter.base.BasePresenterImp;
import com.zy.qudadid.ui.view.OwnContactView;

import rx.Subscriber;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by ninos on 2016/7/29.
 */
public class OwnContactPresenter extends BasePresenterImp<OwnContactView> {
    public void GetCityList(){
        Subscription subscription = Net.getService()
                .getAboutInfo("public","getArticleInfo","about","2")
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Subscriber<Res<About>>() {

                    @Override
                    public void onCompleted() {
                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onNext(Res<About> res) {
                        if (res.code== Const.OK){
                            view.success(res.datas);
                        }else {

                        }
                    }
                });

        addSubscription(subscription);
    }
}
